package com.example.indenture.message.entity;

import com.example.indenture.common.entity.AbstractEntity;
import com.example.indenture.company.entity.Company;
import com.example.indenture.user.entity.User;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.time.LocalDateTime;

/**
 * @author gzp
 * @create 2023-02-22 10:25
 */

@Data
@Entity
@Table(name = "message")
public class Message extends AbstractEntity {
    private int uid;
    private int rid;
    private String des;
    private int pre;

    @Transient
    private User user;

    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createDate;

    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;



}
